package Entidades;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="itemReceta")
public class itemReceta implements Serializable{
	private static final long serialVersionUID=1L;
	
	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	@Column(nullable=false, name="idItemRec")
	private int idItemRec;
	
	@OneToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="idReceta")
	private Receta receta;
	
	@OneToMany(fetch=FetchType.EAGER)
	@JoinColumn(name="idProducto")
	private List <Producto> productos;	
}
